<? include('layer/head.html'); ?>

<body class="ly121 usercenter">
	<? include('layer/topnav.html'); ?>
	<? include('layer/header.html'); ?>
	<div class="contenter clrfix">
    	<div class="aside_left">
        	<img class="e_profile_photo profile_photo" src="<?php echo (!empty($viewinfo['avatar']) ? $viewinfo['avatar'] : STATIC_HTTP . 'img/avatar.gif'); ?>" >
        </div>
    	<div class="article">
            <div class="box_border">
            	<div class="wrap section">
                    <div class="hd">基本资料</div>
                    <form class="bd mpt a_userbaseinfo">
                        <div class="box_border levels">
                            <div class="wrap">
                                <ul class="level live clrfix">
                                    <li class="til">主播等级</li>
                                    <li class="icon mpt a_createicon" credit="<?php echo $viewinfo['credit']?>" type="credit"></li>
                                    <li>
                                        <div class="progress_bar">
                                            <div id="dvprogresscredit" class="cover" style="width:50%;"></div>
                                        </div>
                                    </li>
                                </ul>
                                <ul class="level rich clrfix">
                                    <li class="til">富豪等级</li>
                                    <li class="icon mpt a_createicon" wealth="<?php echo $viewinfo['wealth']?>" type="wealth"></li>
                                    <li>
                                        <div class="progress_bar">
                                            <div id="dvprogresswealth" class="cover" style="width:50%;"></div>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <dl class="fieldset clrfix">
                            <dt>用户号码</dt>
                            <dd class="userid">
                                <div class="input_wrap">
                                    <input class="text" disabled value="<?php echo $viewinfo['usernum']; ?>" type="text">
                                    <div class="border_end"></div>
                                </div>
                            </dd>
                        </dl>
                        <dl class="fieldset clrfix">
                            <dt>昵称</dt>
                            <dd class="nickname">
                                <div class="input_wrap">
                                    <input id="txtnickname" class="text" value="<?php echo $viewinfo['nickname']; ?>" <?php if($userinfo['uid'] != $viewinfo['uid']){?> disabled <?php }?> type="text">
                                    <div class="border_end"></div>
                                </div>
                            </dd>
                        </dl>
                        <dl class="fieldset clrfix">
                            <dt>性别</dt>
                            <dd class="gender">
                                <div class="select_wrap">
                                    <select id="selectsex" name="selectsex" disabled>
                                        <option value="1" <?php if($userinfo['sex'] == 1){?>selected="selected" <?php }?>>男</option>
                                        <option value="2" <?php if($userinfo['sex'] == 2){?>selected="selected" <?php }?>>女</option>
                                    </select>
                                    <div class="border_end"></div>
                                </div>
                            </dd>
                        </dl>
                        <dl class="fieldset clrfix">
                            <dt>生日</dt>
                            <dd>
                                <ul class="birthday">
                                    <li>
                                        <div class="select_wrap">
                                            <select id="selectyear" name="selectyear" disabled>
                                                <?php 
                                                for($i=1940;$i<=2012;$i++)
                                                {
                                                   echo '<option value="'.$i.'"';
                                                   if($i == Date('Y',$userinfo['birthday'])){
                                                   		echo ' selected="selected"';
                                                   }
                                                   echo '>'.$i.'</option>';
                                                }
                                                ?>
                                            </select>
                                            <div class="border_end"></div>
                                        </div>
                                    </li>
                                    <li>
                                        年
                                    </li>
                                    <li>
                                        <div class="select_wrap">
                                            <select id="selectmonth" name="selectmonth" disabled>
                                                <option value="1" <?php if(Date('m',$userinfo['birthday']) == 1){?>selected="selected" <?php }?> >1</option>
                                                <option value="2" <?php if(Date('m',$userinfo['birthday']) == 2){?>selected="selected" <?php }?> >2</option>
                                                <option value="3" <?php if(Date('m',$userinfo['birthday']) == 3){?>selected="selected" <?php }?> >3</option>
                                                <option value="4" <?php if(Date('m',$userinfo['birthday']) == 4){?>selected="selected" <?php }?> >4</option>
                                                <option value="5" <?php if(Date('m',$userinfo['birthday']) == 5){?>selected="selected" <?php }?> >5</option>
                                                <option value="6" <?php if(Date('m',$userinfo['birthday']) == 6){?>selected="selected" <?php }?> >6</option>
                                                <option value="7" <?php if(Date('m',$userinfo['birthday']) == 7){?>selected="selected" <?php }?> >7</option>
                                                <option value="8" <?php if(Date('m',$userinfo['birthday']) == 8){?>selected="selected" <?php }?> >8</option>
                                                <option value="9" <?php if(Date('m',$userinfo['birthday']) == 9){?>selected="selected" <?php }?> >9</option>
                                                <option value="10" <?php if(Date('m',$userinfo['birthday']) == 10){?>selected="selected" <?php }?> >10</option>
                                                <option value="11" <?php if(Date('m',$userinfo['birthday']) == 11){?>selected="selected" <?php }?> >11</option>
                                                <option value="12" <?php if(Date('m',$userinfo['birthday']) == 12){?>selected="selected" <?php }?> >12</option>
                                            </select>
                                            <div class="border_end"></div>
                                        </div>
                                    </li>
                                    <li>
                                        月
                                    </li>
                                    <li>
                                        <div class="select_wrap">
                                            <select id="selectday" disabled>
                                                <?php 
                                                for($i=1;$i<=31;$i++)
                                                {
                                                   echo "<option value=".$i.">".$i."</option>";
                                                }
                                                ?>
                                            </select>
                                            <div class="border_end"></div>
                                        </div>
                                    </li>
                                    <li>
                                        日
                                    </li>
                                </ul>
                            </dd>
                        </dl>
                        <dl class="fieldset clrfix">
                            <dt>所在地区</dt>
                            <dd class="region">
                                <ul>
                                    <li>
                                        <div class="select_wrap">
                                            <select id="selectprovince" disabled>
                                                <option>10</option>
                                            </select>
                                            <div class="border_end"></div>
                                        </div>
                                    </li>
                                    <li>
                                        省
                                    </li>
                                    <li>
                                        <div class="select_wrap">
                                            <select id="selectcity" disabled>
                                                <option>10</option>
                                            </select>
                                            <div class="border_end"></div>
                                        </div>
                                    </li>
                                </ul>
                            </dd>
                        </dl>
                        <dl class="fieldset clrfix">
                            <dt>个人介绍</dt>
                            <dd>
                                <div class="textarea_wrap">
                                    <textarea id="txtsignature" disabled><?php echo $viewinfo['signature']; ?></textarea>
                                </div>
                            </dd>
                        </dl>
                    </form>
                </div>
            </div>
        </div>
    	<div class="aside_right">
        
        <!---------最近直播Begin-------->
        <?php if($viewinfo['usertype'] == 1){?>
        	<div class="current_live">
            	<div class="hd"><span class="pngFix">最近播出情况</span></div>
                <div class="bd">
                
                <?php if($roomwork){foreach($roomwork as $key=>$val){?>
                	<?php if(!empty($val)){?>
                    <div class="box_border">
                        <div class="wrap">
                            <dl>
                            	<dt>播出时长：
                                <?php if($roominfo && $roominfo['openstatic'] == 1 && $key < 1){
                                    $opentime = abs(intval((time() - $val['time'])/60)); 
                                    if($opentime > 60){
                                        echo intval($opentime/60).'小时 '.($opentime%60).'分钟';
                                     }else{
                                        echo $opentime.'分钟';
                                     }
                                }else{
                                	$opentime = abs(intval(($val['endtime']-$val['time'])/60)); 
                                    if($opentime > 60){
                                        echo intval($opentime/60).'小时 '.($opentime%60).'分钟';
                                     }else{
                                        echo $opentime.'分钟';
                                     }
                                }?>
                                </dt>
                                <dd>开播时间 <?$otime = $val['time']>$val['endtime']?$val['endtime']:$val['time'];if(!$otime || 0 >= $otime ){$otime = $val['time']>0?$val['time']:time();} echo Date('Y-m-d H:i:s',$otime);?></dd>
                                <dd>结束时间 <?php if($key < 1 && $roominfo['openstatic'] == 1){echo '正在直播';}else{$ctime = $val['endtime']>$val['time']?$val['endtime']:$val['time']; echo Date('Y-m-d H:i:s',$ctime);}?></dd>
                            </dl>
                        </div>
                    </div>
                    <?php }?>
                 <?php }}?>   
                    
                </div>
            </div>
            <?php }?>
        <!---------最近直播End-------->
            
        </div>
    </div>
	<? include('layer/footer.html'); ?>
<? include('layer/foot.html'); ?>
<script>
	MPT.Config("vinfo", <?php if($viewinfo){echo json_encode($viewinfo);}else{echo '{}';} ?>);
</script>  
<? include('layer/jsstart.html'); ?>
